<template>
 <view>
    <view class="order_detail">
      <view class="order_info">
        <view class="top">
          <view class="image">
              <image class="avatar1" :src="good_info.cover_image"></image>
          </view>
          <view class="order_title"
            >{{good_info.goods_title}}</view
          >
        </view>
        <view class="bottom">
            <view class="flex1">描述</view>
            <view class="order_no">{{good_info.goods_short_desc}}</view>
        </view>
      </view>
      <view class="flex"> 
          <view class="flex1">库存</view>
          <view class="order_no">{{good_info.goods_available_amt}}</view>
      </view>
      <view class="flex"> 
          <view class="flex1">原价</view>
          <view class="order_no">{{good_info.price
}}</view>
      </view>
      <view class="flex"> 
          <view class="flex1">折扣价</view>
          <view class="order_no">{{good_info.price2}}</view>
      </view>
      <view class="flex"> 
          <view class="flex1">佣金比例</view>
          <view class="order_no">{{good_info.commission_rate}}%</view>
      </view>
      <!-- <view class="flex"> 
          <view class="flex1">营收</view>
          <view class="order_no">{{good_info.platform_price*good_info.goods_amt*(1-good_info.commission_rate) | toFixed2}}</view>
      </view> -->
      <view class="flex"> 
          <view class="flex1">店名</view>
          <view class="order_no">{{good_info.mch_name}}</view>
      </view>
      <!-- <view class="flex"> 
          <view class="flex1">支付时间</view>
          <view class="order_no">{{good_info.pay_time | moment}}</view>
      </view> -->
    </view>
  </view>
</template>

<script>
import {goods_detail} from '../../utils/imapi'
export default {
  props: {

  },
  components: {

  },
  data() {
    return {
        id:'',
        good_info:{}
    };
  },
  computed: {

  },
  watch: {

  },
  onLoad(options) {
      this.id = options.id
        this.p=options.p
      this.goods_detail()
  },
  onReady() {

  },
  onShow() {

  },
  methods: {
     async goods_detail() {
         try {
             const data = await goods_detail({
                 item_id:this.id,
                 p:this.p
             })
             if(data.code==0) {
                 this.good_info=data.data.goods
             }
             console.log(data);
         } catch (error) {
             
         }
     }
  },
  onReachBottom () {

  },
  onHide () {

  },
};
</script>

<style scoped lang="scss" scoped>
    .order_detail {
  width: 100%;
  padding-left: 32upx;
  padding-right: 44upx;
font-size: 28upx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0A0819;

  .order_info {
      border-bottom: 2upx solid #F0EEFD;
      padding: 36upx 0 20upx;
      .top {
          display: flex;
          align-items: center;
         
      }
  }
}
.image {
      width: 160upx;
    height: 160upx;
    border-radius: 10upx;
    margin-right: 20upx;
}
.avatar1 {
    width: 160upx;
    height: 160upx;
     border-radius: 10upx;
}
.bottom {
    display: flex;
    align-items: center;
    margin-top: 20upx;
}
.flex1 {
       width: 160upx;
       margin-right: 20upx;
}
.flex {
      display: flex;
    align-items: center;
    height: 82upx;
    border-bottom: 2upx solid #F0EEFD;
}
</style>
